package edu.mit.media.fv.components
{
	import flash.display.*;
	import flash.text.*;
	
	public class FVLabel extends Sprite
	{
		private var field:TextField;
		public function FVLabel(x:int, y:int, width:int = 100, height:int = 35, text:String = "", align:String = TextFormatAlign.RIGHT)
		{
			var format:TextFormat = new TextFormat();
			format.align = align;
			format.bold = true;
			format.font = "Arial";
			format.size = height*0.6;
			format.color = 0xFFFFFF;
			
			field = new TextField();
			field.defaultTextFormat = format;
			field.type = TextFieldType.DYNAMIC;
			field.selectable = false;
			field.width = width;
			field.height = height;
			field.text = text;
			this.addChild(field);
			
			this.x = x;
			this.y = y;
		}
		
		public function set text(text:String):void{
			this.field.text = text;
		}
		public function get text():String{
			return this.field.text;
		}

	}
}